home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Apple WWDC 1996
/
WWDC96_1996 (CD).toast
/
Technology Materials
/
MacOS 8 Resources
/
Developer Tools
/
Mac OS 8 Interfaces & Libraries
/
Interfaces
/
AIncludes
/
TextEncodingConverter.a
< prev
next >
Wrap
Text File
|
1996-05-01
|
6KB
|
230 lines
;
; File: TextEncodingConverter.a
;
; Contains: Text Encoding Conversion Interfaces.
;
; Version: Technology: System 7.1 through System 8
; Release: Universal Interfaces 3.0d3 on Copland DR1
;
; Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved.
;
; Bugs?: If you find a problem with this file, send the file and version
; information (from above) and the problem description to:
;
; Internet: apple.bugs@applelink.apple.com
; AppleLink: APPLE.BUGS
;
;
IF &TYPE('__TEXTENCODINGCONVERTER__') = 'UNDEFINED' THEN
__TEXTENCODINGCONVERTER__ SET 1
IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
include 'Types.a'
ENDIF
IF &TYPE('__MIXEDMODE__') = 'UNDEFINED' THEN
include 'MixedMode.a'
ENDIF
IF &TYPE('__UNICODE__') = 'UNDEFINED' THEN
include 'Unicode.a'
ENDIF
IF FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE THEN
; converter object reference
; character substitution
CharSubstitution RECORD 0
originalChar ds.l 1 ; offset: $0 (0)
replacementChar ds.l 1 ; offset: $4 (4)
sizeof EQU * ; size: $8 (8)
ENDR
CharSubstitutionList RECORD 0
numberOfSubstitutions ds.l 1 ; offset: $0 (0)
list ds CharSubstitution ; offset: $4 (4) <-- really an array of length one
sizeof EQU * ; size: $C (12)
ENDR
; invalid character lists
InvalidCharRange RECORD 0
firstCharInRange ds.l 1 ; offset: $0 (0)
lastCharInRange ds.l 1 ; offset: $4 (4)
sizeof EQU * ; size: $8 (8)
ENDR
InvalidCharRangeList RECORD 0
numberOfRanges ds.l 1 ; offset: $0 (0)
list ds InvalidCharRange ; offset: $4 (4) <-- really an array of length one
sizeof EQU * ; size: $C (12)
ENDR
; encoding conversion options
EncodingOptions RECORD 0
sourceflags ds.w 1 ; offset: $0 (0)
destflags ds.w 1 ; offset: $2 (2)
maxLineLength ds.l 1 ; offset: $4 (4)
sizeof EQU * ; size: $8 (8)
ENDR
ENDIF
IF FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE THEN
; return number of encodings types supported by user's configuraton of the encoding converter
;
; pascal OSStatus CountAvailableTextEncodings(ItemCount *numberOfMappings)
;
IF ¨ GENERATINGCFM THEN
Macro
_CountAvailableTextEncodings
move.w #$021A,D0
dc.w $ABCE
EndM
ELSE
IMPORT_CFM_FUNCTION CountAvailableTextEncodings
ENDIF
; fill in an array of type TextEncoding passed in by the user with types of encodings the current configuration of the encoder can handle.
;
; pascal OSStatus GetAvailableTextEncodings(TextEncoding *availableEncodings, ItemCount maxAvailableEncodings, ItemCount *actualAvailableEncodings)
;
IF ¨ GENERATINGCFM THEN
Macro
_GetAvailableTextEncodings
move.w #$061B,D0
dc.w $ABCE
EndM
ELSE
IMPORT_CFM_FUNCTION GetAvailableTextEncodings
ENDIF
; create a converter object with default conversion characteristics
;
; pascal OSStatus NewEncodingConverter(EncodingConverterRef *newEncodingConverter, TextEncoding inputEncoding, TextEncoding outputEncoding)
;
IF ¨ GENERATINGCFM THEN
Macro
_NewEncodingConverter
move.w #$061C,D0
dc.w $ABCE
EndM
ELSE
IMPORT_CFM_FUNCTION NewEncodingConverter
ENDIF
; disose and encoding converter object
;
; pascal OSStatus DisposeEncodingConverter(EncodingConverterRef *newEncodingConverter)
;
IF ¨ GENERATINGCFM THEN
Macro
_DisposeEncodingConverter
move.w #$021D,D0
dc.w $ABCE
EndM
ELSE
IMPORT_CFM_FUNCTION DisposeEncodingConverter
ENDIF
; manage substitution lists
;
; pascal OSStatus SetConverterSubstitutionList(EncodingConverterRef *encodingConverter, CharSubstitutionList *charSubstitutionPtr)
;
IF ¨ GENERATINGCFM THEN
Macro
_SetConverterSubstitutionList
move.w #$041E,D0
dc.w $ABCE
EndM
ELSE
IMPORT_CFM_FUNCTION SetConverterSubstitutionList
ENDIF
;
; pascal OSStatus GetConverterSubstitutionListCount(EncodingConverterRef *encodingConverter, ItemCount *count)
;
IF ¨ GENERATINGCFM THEN
Macro
_GetConverterSubstitutionListCount
move.w #$041F,D0
dc.w $ABCE
EndM
ELSE
IMPORT_CFM_FUNCTION GetConverterSubstitutionListCount
ENDIF
;
; pascal OSStatus GetConverterSubstitutionList(EncodingConverterRef *encodingConverter, CharSubstitutionList *charSubstitutionPtr)
;
IF ¨ GENERATINGCFM THEN
Macro
_GetConverterSubstitutionList
move.w #$0220,D0
dc.w $ABCE
EndM
ELSE
IMPORT_CFM_FUNCTION GetConverterSubstitutionList
ENDIF
; manage invalid character lists
;
; pascal OSStatus SetConverterInvalidCharRangeList(EncodingConverterRef *encodingConverter, InvalidCharRangeList *invalidCharPtr)
;
IF ¨ GENERATINGCFM THEN
Macro
_SetConverterInvalidCharRangeList
move.w #$0421,D0
dc.w $ABCE
EndM
ELSE
IMPORT_CFM_FUNCTION SetConverterInvalidCharRangeList
ENDIF
;
; pascal OSStatus GetConverterInvalidCharRangeListCount(EncodingConverterRef *encodingConverter, ItemCount *count)
;
IF ¨ GENERATINGCFM THEN
Macro
_GetConverterInvalidCharRangeListCount
move.w #$0422,D0
dc.w $ABCE
EndM
ELSE
IMPORT_CFM_FUNCTION GetConverterInvalidCharRangeListCount
ENDIF
;
; pascal OSStatus GetConverterInvalidCharRangeList(EncodingConverterRef *encodingConverter, InvalidCharRangeList *invalidCharPtr)
;
IF ¨ GENERATINGCFM THEN
Macro
_GetConverterInvalidCharRangeList
move.w #$0423,D0
dc.w $ABCE
EndM
ELSE
IMPORT_CFM_FUNCTION GetConverterInvalidCharRangeList
ENDIF
;
; pascal OSStatus ConvertTextEncoding(EncodingConverterRef *encodingConverter, Boolean clearContext, BytePtr *inputText, ByteCount *inputLength, BytePtr outputBuffer, ByteCount outputBufferSize, ByteCount *actualOutputLength)
;
IF ¨ GENERATINGCFM THEN
Macro
_ConvertTextEncoding
move.w #$1024,D0
dc.w $ABCE
EndM
ELSE
IMPORT_CFM_FUNCTION ConvertTextEncoding
ENDIF
;
; pascal OSStatus ExamineTextEncoding(BytePtr *inputText, ByteCount *inputLength, TextEncoding *availableEncodings, ItemCount maxAvailableEncodings, Boolean *validEncoding)
;
IF ¨ GENERATINGCFM THEN
Macro
_ExamineTextEncoding
move.w #$0A25,D0
dc.w $ABCE
EndM
ELSE
IMPORT_CFM_FUNCTION ExamineTextEncoding
ENDIF
ENDIF
ENDIF ; __TEXTENCODINGCONVERTER__